// 1、整个数组数据类型一致
let num1Array: Array<number | string> = [1, 2, 3, 'hello', 'world'];
let num2Array: number[] = [1, 2, 3];//推荐使用
console.log('num1Array=', num1Array, '\nnum2Array=', num2Array);

// 2、整个数组数据类型不一致
let num3Array: (number | string | boolean)[] = ['hello', 123, true, false]
let num4Array: any[] = ['hello', 123, true, false, null, undefined]
let num5Array: [number, boolean, string] = [123, true, 'hello']
console.log('num3Array=', num3Array, '\nnum4Array=', num4Array, '\nnum5Array=', num5Array);